<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMessageTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('message')) {
            Schema::create('message', function(Blueprint $table)
            {
                $table->increments('id');
                $table->integer('user_id')->default(0)->comment('用户id');
                $table->string('content')->nullable()->comment('评论内容');
                $table->integer('to_user_id')->default(0)->comment('是否已查看');
                $table->integer('d_id')->default(0)->comment('打卡id');
                $table->integer('is_read')->default(0)->comment('是否已查看');
                $table->softDeletes();
                $table->timestamps();
            });
        }

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
